package com.yupi.springbootinit.model.vo.pmc;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class PmcGroupedBatchesVO implements Serializable {
    // ========== ✅ 新增：父任务信息 ==========
    private Long parentTaskId;
    private String parentTaskTitle;
    private String parentTaskStatus;
    private Long parentTaskClaimedBy;
    private String parentTaskClaimedByName;
    private LocalDateTime parentTaskClaimedTime;

    // ========== 原有字段 ==========
    private String orderNumber;
    private String productName;
    private Integer quantitySum;
    private LocalDateTime dueDate;
    private String createdByName;
    private LocalDateTime createTime;

    // ========== 子批次列表 ==========
    private List<BatchItem> batches;

    @Data
    public static class BatchItem implements Serializable {
        // ========== ✅ 新增：子任务信息 ==========
        private Long subTaskId;            // 子任务ID（PUBLISH_BATCH）
        private String subTaskStatus;      // 子任务状态
        private Long subTaskClaimedBy;
        private String subTaskClaimedByName;

        // ========== 原有字段 ==========
        private Long id;
        private String batchCode;
        private String status;             // 批次状态
        private LocalDateTime planStart;
        private LocalDateTime planEnd;
        private LocalDateTime publishTime;
        private Integer quantity;
        private String deviceName;
        private List<ProductInfo> products;
        private String flowNumber;
        private String productionPlanNumber;
    }

    @Data
    public static class ProductInfo implements Serializable {
        private String productCode;
        private String productName;
        private String specification;
        private BigDecimal productHeight;
        private BigDecimal part_drawing_no;
        private BigDecimal unitWeight;
        private Integer quantity;
    }
    private static final long serialVersionUID = 1L;
}
